<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" class="mobile">
    <div class="message"></div>
    <div class="message2"></div>
    <button>获取</button>
    <button>设置</button>
    <script>
        document.querySelectorAll('button')[1].onclick = function(){
            document.querySelector('input').value = '110';
            document.querySelector('.message').innerHTML = '<strong>商品名称</strong>'
            document.querySelector('.message2').textContent = '<strong>商品名称</strong>'
        }
        document.querySelectorAll('button')[0].onclick = function(){
            console.log(document.querySelector('input').value)
            console.log(document.querySelector('.message').innerHTML)
            console.log(document.querySelector('.message2').textContent) 
        }

        // textContent属性 可以用于处理双标签中的内容  但是不解析标签
    </script>
</body>
</html>